<div class="page-title clearfix">
  <div class="title">TestOption管理</div>
  <button nz-button class="fr btn-green" [routerLink]="routerLinks.testOption.add" title="{{'Btn0003'| translate}}"><i
    class="anticon anticon-plus"></i>
    {{'Btn0003'| translate}}
  </button>
</div>

<div class="panel panel-body">
  <!--搜索 start-->
  <form nz-form (submit)="queryTestOptionList(1)">
    <div class="search-group">
      <span class="search-title">testOption名：</span>
      <div class="search-main">
        <input nz-input name="name"
               [(ngModel)]="searchParams.name"
               placeholder="{{'Supplier0001'| translate}}">
      </div>
    </div>
    <div class="inline-block">
      <button nz-button class="ml-20 mr" [nzType]="'primary'" title="{{'Btn0001'| translate}}" type="submit">
        <i class="anticon anticon-search"></i><span>{{"Btn0001"| translate}}</span>
      </button>
      <button nz-button class="mr" title="{{'Btn0002'| translate}}" type="reset" (click)="resetSearch()">
        <i class="anticon anticon-sync"></i><span>{{"Btn0002"| translate}}</span>
      </button>
    </div>
  </form>
  <!--搜索 end-->
</div>
<div class="panel">
  <nz-table #nzTable
            [nzData]="testOptionList.voList"
            [nzLoading]="_loading"
            [nzFrontPagination]="false"
            [nzShowTotal]="totalRow"
            [nzPageSize]="testOptionList.pageSize"
            [nzTotal]="testOptionList.totalRow"
            [nzPageIndex]="testOptionList.curPage"
            (nzPageIndexChange)="queryTestOptionList($event)">
    <thead nz-thead>
    <ng-template #totalRow>{{'Th0000' | translate : {totalRow: testOptionList.totalRow} }}</ng-template>
    <tr>
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0001' | translate}}</span></th><!--序号-->
      <th nz-th class="text-center" nzWidth=""><span> 测试项</span></th><!--测试项-->
      <th nz-th class="text-center" nzWidth=""><span>状态 启</span></th><!--状态 启用 enable,禁用 disable-->
      <th nz-th class="text-center" nzWidth=""><span> 测试排序</span></th><!--测试排序-->
      <th nz-th class="text-center" nzWidth=""><span> 创建时间</span></th><!--创建时间-->
      <th nz-th class="text-center" nzWidth=""><span> 版本</span></th><!--版本-->
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0003' | translate}}</span></th><!--状态-->
      <th nz-th class="text-center" nzWidth=""><span>{{'Th0006' | translate}}</span></th><!--操作-->
    </tr>
    </thead>
    <tbody nz-tbody>
    <ng-template ngFor let-data [ngForOf]="nzTable.data" let-i="index">
      <tr nz-tbody-tr>
        <td nz-td class="text-center">{{i+1}}</td>
        <td nz-td class="text-center">{{data.option}}</td>
        <td nz-td class="text-center">{{data.state}}</td>
        <td nz-td class="text-center">{{data.sort}}</td>
        <td nz-td class="text-center">{{data.createTime}}</td>
        <td nz-td class="text-center">{{data.ver}}</td>
        <td nz-td class="text-center">
          <nz-switch class="thc" [ngModel]="data.state === states.enable" [ngModelOptions]="{standalone: true}"
                     nzCheckedChildren="是" nzUnCheckedChildren="否"
                     (ngModelChange)="modifyTestOptionState(data.code, $event)">
          </nz-switch>
        </td>
        <td nz-td class="text-center">
          <button nz-button class="btn-blue-o mr" [routerLink]="[routerLinks.testOption.modify,data.code]"
                  title="{{'Btn0004'| translate}}">
            <i class="anticon anticon-edit"></i></button>
          <button nz-button class="btn-success-o" [routerLink]="[routerLinks.testOption.detail,data.code]"
                  title="{{'Btn0005'| translate}}">
            <i class="anticon anticon-eye-o"></i></button>
        </td>
      </tr>
    </ng-template>
    </tbody>
  </nz-table>
</div>
